package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.MarketComment;
import com.cskaoyan.bean.param.BaseParam;
import com.cskaoyan.bean.CommentData;
import com.cskaoyan.service.CommentService;
import com.cskaoyan.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Kongwo
 * @description
 * @since 2022/05/06 17:04
 */

@RestController
@RequestMapping("admin/comment")
public class CommentController {

    @Autowired
    CommentService commentService;

    @GetMapping("list")
    public BaseRespVo commentList(String userId, String valueId, BaseParam param) {

        CommentData commentData = commentService.getCommentList(userId, valueId, param);
        return BaseRespVo.ok(commentData);
    }

    @PostMapping("delete")
    public BaseRespVo deleteComment(@RequestBody MarketComment comment) {

        commentService.deleteComment(comment);
        return BaseRespVo.ok(null);
    }

}
